<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>获奖查询</title>
<script src="js/public/mobile-base.js"></script>
<link href="css/lib/mobile-reset.css" rel="stylesheet" type="text/css"/>
<link href="css/components/common.css" rel="stylesheet" type="text/css"/>
<link href="css/pages/form.css" rel="stylesheet" type="text/css"/>
</head>
<body class="pub-bg">
		<!-- <img src="images/public/share-img.jpg" width="0" height="0" class="hide"/> -->
		<div class="info-edit-page owner-edit ">
			<!-- <div class="logo-box">
				<img src="images/public/logo.png" alt ="logo"/>
			</div> -->
			<div class="dealer-edit-cont">
				<div class="dealer-edit-cont-title pub-btn">
					获奖查询
				</div>
				<div class="gift-box pub-cont-box">
					<div class="gift-search-box">
						<input type="text" value="" placeholder="请输入搜索关键字" id="search-key"/>
						<div class="gift-search-btn" id="search-btn">
						</div>
					</div>
					<div class="gift-box-cont">
						<div class="gift-box-cont-tab">
						<table width="100%">
							<thead>
								<tr>
									<td>姓名</td>
									<td>经销商</td>
									<td>抽中奖品</td>
									<td>已推荐人数</td>
								</tr>
							</thead>
							<tbody id="list-box">
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
								<tr>
									<td>李xx</td>
									<td>南昌</td>
									<td>200元京东卡</td>
									<td>7</td>
								</tr>
							</tbody>
						</table>
						</div>
					</div>
					<div class="gift-list-btn">
						<a href="javascript:;" class="pub-btn gift-btn" >
							返回
						</a>
					</div>
				</div>
				<div class="pub-car-bottom">
				</div>
			</div>
		</div>
    <script src="js/public/zepto.min.js"></script>
    <script src="js/public/dialogPrompt.js"></script>
    <script src="/resources/js/public/common.js"></script>
    <script>
    		 $(document).ready(function(){
    			var eleSearchInput = $('#search-key');
    			var eleSearchBtn = $('#search-btn');
    			var eleListBox = $('#list-box');

    			eleSearchBtn.on('click', function(){
    				var searchVal = $.trim(eleSearchInput.val());
    				if(searchVal == ''){
    					ECar.dialogPrompt({text:'请输入要搜索的关键字',clickClose:true});
    					return;
    				}
    				$.ajax({
					type: "POST",
					url: '/?.htm',
					data:{
						searchKey:  searchVal
					},
					dataType: "JSON",
					success: function(data){
						var giftList = data;
						var giftListHtml = '';
						if(data === "-1" || data == -1){
							ECar.dialogPrompt({text:'您一天只能点一次赞哦！<br/>请24小时之后再来',clickClose:true});
						}else{
							for(var i= 0;i<giftList.length;i++){
								giftListHtml += '<tr>';
								giftListHtml += '<td>' + giftList[i].name + '</td>';
								giftListHtml += '<td>' + giftList[i].jxs + '</td>';
								giftListHtml += '<td>' + giftList[i].giftName + '</td>';
								giftListHtml += '<td>' + giftList[i].tjNumber + '</td>';
								giftListHtml += '</tr>';
							}
							eleListBox.html(giftListHtml);
						}
					},
					error: function(){
						eleListBox.html('');
					}
			  	});
    			})
    		});
    </script>
</body>
</html>